#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Text-Tool: 专业的文本处理工具库
包含字数统计、文本分析等功能模块
"""

from setuptools import setup, find_packages
import os

# 读取长描述
def read_long_description():
    """读取README文件作为长描述"""
    here = os.path.abspath(os.path.dirname(__file__))
    try:
        with open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
            return f.read()
    except FileNotFoundError:
        return "专业的文本处理工具库，提供字数统计、文本分析等功能。"

# 读取版本号
def read_version():
    """从版本文件读取版本号"""
    here = os.path.abspath(os.path.dirname(__file__))
    try:
        with open(os.path.join(here, 'text_tool', '__version__.py'), encoding='utf-8') as f:
            exec(f.read())
            return locals()['__version__']
    except FileNotFoundError:
        return "1.0.0"

setup(
    name="text-tool",
    version=read_version(),
    author="yideng",
    author_email="mooremmok@163.com",
    description="专业的文本处理工具库，支持多语言字数统计和文本分析",
    long_description=read_long_description(),
    long_description_content_type="text/markdown",
    url="https://github.com/yourusername/text-tool",
    packages=find_packages(),
    classifiers=[
        "Development Status :: 5 - Production/Stable",
        "Intended Audience :: Developers",
        "Topic :: Software Development :: Libraries :: Python Modules",
        "Topic :: Text Processing",
        "Topic :: Text Processing :: Linguistic",
        "License :: OSI Approved :: MIT License",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3.10",
        "Programming Language :: Python :: 3.11",
        "Programming Language :: Python :: 3.12",
        "Operating System :: OS Independent",
        "Natural Language :: Chinese (Simplified)",
        "Natural Language :: English",
    ],
    keywords="text processing, word count, chinese text, academic document, text analysis",
    python_requires=">=3.8",
    install_requires=[
        # 目前只需要标准库，无额外依赖
    ],
    extras_require={
        "dev": [
            "pytest>=6.0",
            "pytest-cov>=2.0",
            "black>=21.0",
            "flake8>=3.8",
            "mypy>=0.910",
        ],
        "test": [
            "pytest>=6.0",
            "pytest-cov>=2.0",
        ],
    },
    project_urls={
        "Bug Reports": "https://github.com/yourusername/text-tool/issues",
        "Source": "https://github.com/yourusername/text-tool",
        "Documentation": "https://text-tool.readthedocs.io/",
    },
    include_package_data=True,
    zip_safe=False,
)